﻿Public Class ucNewItem
    Public Shared ReadOnly CancelButtonClickedEvent As RoutedEvent = EventManager.RegisterRoutedEvent("CancelButtonClicked", RoutingStrategy.Bubble, GetType(RoutedEventHandler), GetType(ucNewItem))
    Public Custom Event CancelButtonClicked As RoutedEventHandler
        AddHandler(ByVal value As RoutedEventHandler)
            Me.AddHandler(CancelButtonClickedEvent, value)
        End AddHandler

        RemoveHandler(ByVal value As RoutedEventHandler)
            Me.RemoveHandler(CancelButtonClickedEvent, value)
        End RemoveHandler

        RaiseEvent(ByVal sender As Object, ByVal e As RoutedEventArgs)
            Me.RaiseEvent(e)
        End RaiseEvent
    End Event

    Public Shared ReadOnly OkButtonClickedEvent As RoutedEvent = EventManager.RegisterRoutedEvent("OkButtonClicked", RoutingStrategy.Bubble, GetType(RoutedEventHandler), GetType(ucNewItem))
    Public Custom Event OkButtonClicked As RoutedEventHandler
        AddHandler(ByVal value As RoutedEventHandler)
            Me.AddHandler(OkButtonClickedEvent, value)
        End AddHandler

        RemoveHandler(ByVal value As RoutedEventHandler)
            Me.RemoveHandler(OkButtonClickedEvent, value)
        End RemoveHandler

        RaiseEvent(ByVal sender As Object, ByVal e As RoutedEventArgs)
            Me.RaiseEvent(e)
        End RaiseEvent
    End Event

    'Public Shared TestNameProperty As DependencyProperty = DependencyProperty.Register("TestName", GetType(String), GetType(ucNewUser), New PropertyMetadata(String.Empty))

    '' <summary>
    '' Gets or sets the control's text
    '' </summary>
    'Public Property TextExposedInXaml() As String
    '    Get
    '        Return DirectCast(GetValue(TestNameProperty), String)
    '    End Get

    '    Set(value As String)

    '        ' set the value of the control's text here...!
    '        SetValue(TestNameProperty, value)
    '    End Set
    'End Property


    Private Sub OkButton_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles OkButton.Click
        e.Handled = True
        Dim args As New RoutedEventArgs(OkButtonClickedEvent)
        MyBase.RaiseEvent(args)

    End Sub

    Private Sub CancelButton_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles CancelButton.Click
        Dim args As New RoutedEventArgs(CancelButtonClickedEvent)
        MyBase.RaiseEvent(args)
    End Sub

    Public Property busyAnimationNewUser_visibility As Visibility
        Get
            Return Me.busyAnimationNewUser.Visibility
        End Get
        Set(value As Visibility)
            Me.busyAnimationNewUser.Visibility = value
        End Set
    End Property

    Public Property ucLabel As String
        Get
            Return newItemTitle.Content
        End Get
        Set(value As String)
            newItemTitle.Content = value
        End Set
    End Property



End Class
